﻿
@{
    ViewBag.Title = "SalesList";
    Layout = "~/Views/Shared/_Index.cshtml";
}

<!DOCTYPE html>
<script>
    $(function () {
        gridList();
    })
    function gridList() {
        var $gridList = $("#gridList");
        $gridList.newtouchLocalDataGrid({
            height: $(window).height() - 210,
            datatype: "local",
            unwritten: false,
            colModel: [
                 { label: "主键", name: "patid", hidden: true },
                 { label: '项目名称', name: 'dlmc', width: 100, align: 'left', editor: "text" },
                 { label: '销售人员', name: 'xsry', width: 100, align: 'left', editor: "text" },
                 { label: '分类', name: 'flmc', width: 100, align: 'left', editor: "text" },
                 { label: '单价', name: 'dj', width: 100, align: 'left', editor: "text" },
                 { label: '数量', name: 'dw', width: 100, align: 'left', editor: "text" },
                 { label: '自付比例', name: 'zfbl', width: 100, align: 'left', editor: "text" },
                 { label: '总金额', name: 'je', width: 100, align: 'left', editor: "text" },
                 { label: '操作时间', name: 'czsj', width: 100, align: 'left', editor: "text" }
            ],
            pager: "#gridPager",
            sortname: 'desc',
            rowNum: '10',
            viewrecords: true
        });

        var mydata = [
            { id: "1", sfxm: "1", dlmc: "轮椅", py: "LunYi", dw: "1", dj: "￥11700", flmc: "器材", zfbl: "0", ybdm: "", wjdm: "10000001", mzzybz: "门诊", je: "￥100.20", czsj: "2017-04-10", xsry: "张三" },
            { id: "2", sfxm: "2", dlmc: "口罩", py: "KouZhao", dw: "1", dj: "￥15", flmc: "器材", zfbl: "0", ybdm: "", wjdm: "10000002", mzzybz: "通用", je: "￥100.20", czsj: "2017-04-10", xsry: "李四" },
            { id: "3", sfxm: "3", dlmc: "按摩椅", py: "AnMoYi", dw: "2", dj: "￥5400", flmc: "器材", zfbl: "0", ybdm: "", wjdm: "10000003", mzzybz: "住院", je: "￥100.20", czsj: "2017-04-10", xsry: "王五" }
        ];
        for (var i = 0; i <= mydata.length; i++) {
            $gridList.jqGrid('addRowData', i + 1, mydata[i]);
        }
    }
    function btn_edit() {
        var keyValue = $("#gridList").jqGridRowValue().sfxmbh;
        $.modalOpen({
            id: "Form",
            title: "修改信息",
            url: "",//"/SystemManage/SysChargeItem/Form?keyValue=" + keyValue,
            width: "700px",
            height: "520px",
            callBack: function (iframeId) {
                top.frames[iframeId].submitForm();
            }
        });
    }
    function btn_delete() {
        $.deleteForm({
            url: "",//"/SystemManage/SysChargeItem/DeleteForm",
            param: { keyValue: $("#gridList").jqGridRowValue().sfxmbh },
            success: function () {
                $("#gridList").trigger("reloadGrid");
            }
        })
    }
    function btn_details() {
        var keyValue = $("#gridList").jqGridRowValue().sfxmbh;
        $.modalOpen({
            id: "Details",
            title: "查看机构",
            url: "",//"/SystemManage/SysChargeItem/Form?keyValue=" + keyValue,
            width: "700px",
            height: "560px",
            btn: null,
        });
    }
    function submitForm() {
        if (!$('#form1').formValid()) {
            return false;
        }
        $.submitForm({
            url: "",//"/SystemManage/SysChargeItem/SubmitForm?keyValue=" + keyValue,
            param: $("#form1").formSerialize(),
            success: function () {
                $("#gridList").resetSelection();
                $("#gridList").trigger("reloadGrid");
                $.loading(false);
            }
        })
    }
</script>
<form id="form1">
    <div class="panel panel-default" style="margin-top:5px;">
        <div class="panel-heading">
            筛选条件
        </div>
        <div style="padding: 2px;padding-right:20px;">
            <table class="form">
                <tr>
                    <td class="formTitle">开始时间</td>
                    <td class="formValue">
                        <input id="Kssj" type="text" class="form-control input-wdatepicker" value="@DateTime.Now.ToString("yyyy-MM-01")" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" />
                    </td>
                    <td class="formTitle">结束时间</td>
                    <td class="formValue">
                        <input id="Jssj" type="text" class="form-control input-wdatepicker" value="@DateTime.Now.ToString("yyyy-MM-01")" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" />
                    </td>
                    <td class="formTitle">关键字</td>
                    <td class="formValue">
                        <input type="text" id="txtINPUTCODE" class="form-control" placeholder="名称" />
                    </td>
                    <td class="formTitle">
                        销售人员:
                    </td>
                    <td class="formValue">
                        <select id="Cl" class="form-control">
                            <option value="PT">张三</option>
                            <option value="OT">李四</option>
                            <option value="OT">王五</option>
                        </select>
                    </td>
                    <td class="formTitle">
                        分类:
                    </td>
                    <td class="formValue">
                        <select id="Cl" class="form-control">
                            <option value="PT">器材</option>
                            <option value="OT">保健品</option>
                        </select>
                    </td>
                    <td>
                        <div style="margin-left:20px">
                            <input type="button" id="btn_search" class="btn btn-primary btn-md" value="查询" style="width:55px" />
                        </div>
                    </td>
                </tr>
            </table>
        </div>
    </div>
</form>
<div class="gridPanel">
    <table id="gridList"></table>
    <div id="gridPager"></div>
</div>
@Html.Partial("_BottomButtonsView", new Newtouch.HIS.Web.Core.Models.BottomButtonViewModel
{
    ShowKeyList = new int[] { 9 },
    F9Text = "导出"
})

